<template>
  <div>
        <div id="map_canvas" class="allmap"></div> 
  </div>
</template>
<script>
  export default {
    name : "Bai",
    data() {
      return {
       
      };
    },
    created () {

    },
    methods: {
      drawMap() {
        this.map = new BMap.Map("map_canvas");        // 创建地图实例
        this.map.addControl(new BMap.NavigationControl());      // 启用放大缩小 尺
        this.map.enableScrollWheelZoom();
      

        var point = new BMap.Point(116.404, 39.915); // 创建点坐标
        this.map.centerAndZoom(point, 13);         // 初始化地图，设置中心点坐标和地图级别
        var marker = new BMap.Marker(point);    // 创建标注
        this.map.addOverlay(marker);           // 将标注添加到地图中    
      }
    },
    mounted() {
      this.$nextTick(function() {
        this.drawMap();
      });

    }
  }
</script>
<style scoped>
  .allmap {
    width: 90%;
    height: 500px;
    font-family: "微软雅黑";
    border: 1px solid green;
  }
 
</style>
